///////////////////////////////////////////////////////////////////////////////
// Project: Hoyo Client Game
//
// hy_formation_logic.h
// Created: 2013-7-30
// Author: Like Cheng
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include "hy_includes.h"
#include "hy_formation_data.h"

#ifndef __HY_FORMATION_LOGIC_H__
#define __HY_FORMATION_LOGIC_H__


class hy_formation_logic
{
public:
	hy_formation_logic();
	virtual ~hy_formation_logic();

	static hy_formation_logic* instance();
	static void					purge_instance();

	void			init();
public:
	void						proc_formation_change( void* );
	bool						send_battle_formation_by_player( int player_id );
	bool						send_battle_formation( int player_id, int_vec& iv );

	int							get_formation_free_pos( hy_formation_data* fd );
	bool						add_formation_player_unit( hy_formation_data* fd , int add_player_id, int pos = 0 );
	bool						add_formation_player_uint_by_id( int player_id, int add_player_id, int pos = 0 );
};
#endif